package com.iyoyi.transform;

import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

import com.iyoyi.library.ASM;

import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

public class MainActivity extends AppCompatActivity {
    private Unbinder mUnB;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mUnB = ButterKnife.bind(this);

        findViewById(R.id.btn).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                MainActivity.this.onClick(v);
            }
        });
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mUnB.unbind();
    }

    @ASM(
            id = 100001,
            label = "OnToast",
            describe = "Show Toast"
    )
    public void onClick(View v) {
        Toast.makeText(this, "on toast...", Toast.LENGTH_SHORT).show();
    }

    @OnClick(R.id.click)
    public void butter(View v) {
        Toast.makeText(this, "on click...", Toast.LENGTH_SHORT).show();
    }
}
